<?php
include_once "DB.class.php";
if ($_POST) {
	static $num=array(0,0);
	$arr=explode(",",htmlspecialchars($_POST['word']));
	foreach ($arr as $key => $value) {
	$sql="insert into white_list (title)value('".trim($value)."')";
	$re=$DB->exec($sql);
		if ($re) {
			$num[0]++;
		}else{
			$num[1]++;
		}
    }
    // if ($a>0) {
    	echo json_encode($num);
    	# code...
    // }else{
    // 	echo 0;
    // }
	# code...
}